package com.example.test4;

import java.util.Date;
import java.util.function.BiFunction;
import java.util.function.Supplier;

public class Demo4 {

    public static void main(String[] args) {

        Date date = new Date();
        Supplier<Long> supplier = date::getTime;
        System.out.println(supplier.get());
        Supplier<Long> supplier1 = System::currentTimeMillis;
        System.out.println(supplier1.get());
        BiFunction<String, Integer, String> function2 = String::substring;
        String msg = function2.apply("HelloWorld", 3);
        System.out.println(msg);
        Supplier<Person> supplier2 = Person::new;
        Person person = supplier2.get();
        System.out.println(person);
        person.setAge(12);
        person.setId("1002");
        person.setName("RTX");
        Supplier<String> supplier3 = person::getName;
        System.out.println(supplier3.get());
    }


}
